package com.flea.mvc.service.impl;

import com.flea.mvc.dao.PersonMapper;
import com.flea.mvc.model.Person;
import com.flea.mvc.service.PersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created by lhl on 2014/4/19.
 */
@Service
@Transactional(propagation= Propagation.REQUIRED)
public class PersonServiceImpl implements PersonService {
    @Autowired
    private PersonMapper personMapper;


    @Override
    public Person findPerson(Integer personId) {
        return personMapper.getPerson(personId);
    }

    @Override
    public void insertPerson(Person person) {
    personMapper.insertPerson(person);
    }

    @Override
    public void deletePerson(Integer id) {
    personMapper.deletePerson(id);
    }
}
